package edu.gatech.oad.antlab.person;

/**
 *  A simple class for person 4
 *  returns their name and a
 *  modified string 
 *  
 *  @author Justin
 *  @version 1.2
 */
public class Person4 {
  /** Holds the persons real name */
  private String name;
    /**
     * The constructor, takes in the persons
     * name
     * @param pname the person's real name
     */
  public Person4(String pname) {
    name = pname;
  }
    /**
     * This method takes the string
     * input and returns its characters rotated
     * 1 position.
     *
     * @param input the string to be modified
     * @return the modified string
     */
    private String calc(String input) {
     char temp = input.charAt(0);
	  String shifted = "";
	  for(int i = 0; i<input.length()-1; i++){
	  	shifted += input.charAt(i+1);
     }
	  shifted += temp;
	  return shifted;
    }
    
    /**
     * Return a string rep of this object
     * that varies with an input string
     *
     * @param input the varying string
     * @return the string representing the 
     *         object
     */
    public String toString(String input) {
      return name + calc(input);
    }

}